mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/user-mysql/${2}/init_mysql_user_base.sql
#init activemq
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_activemq_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_activemq_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-uic/${2}/init_activemq.sql
#init base table
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-uic/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/sso/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-cic/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-staffprofile/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-userx/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-portal/${2}/init_portal_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-portal/${2}/init_cms_table.sql
#init base data
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-uic/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/sso/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-cic/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-staffprofile/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-userx/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-portal/${2}/init_data.sql
#init base portal
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-portal/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/sso/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-staffprofile/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-cic/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-uic/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-userx/${2}/init_portal.sql
#init base bxn
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-portal/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-uic/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-platform/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-cic/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-staffprofile/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-userx/${2}/init_bxn.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/sso/${2}/init_bxn.sql

sections=$3
if [ $sections -eq 1 ] || [ $sections -eq 12 ] || [ $sections -eq 13 ] || [ $sections -eq 123 ];then
    echo "has section 1"
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_data_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_data_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_data_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_portal_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_portal_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_portal_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_bxn_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_bxn_1.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_bxn_1.sql
fi
if [ $sections -eq 2 ] || [ $sections -eq 23 ] || [ $sections -eq 123 ] || [ $sections -eq 12 ];then
    echo "has section 2"
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_data_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_data_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_data_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_portal_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_portal_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_portal_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_bxn_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_bxn_2.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_bxn_2.sql
fi
if [ $sections -eq 3 ] || [ $sections -eq 13 ] || [ $sections -eq 123 ] || [ $sections -eq 23 ];then
    echo "has section 3"
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_data_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_data_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_data_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_portal_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_portal_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_portal_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tic/${2}/init_bxn_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-tac/${2}/init_bxn_3.sql
	mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-core-studentprofile/${2}/init_bxn_3.sql
fi


mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/user-role/${2}/init_user_role_base.sql
